<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文件权限检测 - 安装第<?php echo $step;?>步 </title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="install/template/images/installcss.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="install/template/images/jquery.min.js"></script>
<script language="javascript">
function sc()
{
	var e=document.getElementById("introducetd");
	e.scrollTop=e.scrollHeight;
}
</script>
</head>
<body>
<div class="Conten">
<div class="box ">
<div class="instop"><span><a href="<?php echo TCCMS_SITE;?>" target="_blank">官方网站</a>　|　<a href="<?php echo BBS_SITE;?>" target="_blank">官方论坛</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><strong>开始安装<?php echo TCCMS_NAME;?> <?php echo TCCMS_VERSION;?></strong></div>
</div>
  <div class="box">
  <div class="insdirbg">
  <div class="insjd05"></div>
  <div class="insdir_l">
  <div class="t1 by"></div> <div class="t2 by"></div>
  <div class="insdir_lbh">
  <ul>
    <li>1、安装须知</li>
    <li>2、软件许可协议</li>
    <li>3、运行环境检测</li>
    <li>4、文件权限检测</li>
    <li>5、帐号设置</li>
    <li class="dir">6、网络数据初始化</li>
    <li>7、安装完成</li>
    </ul></div>
    <div class="t2 by"></div> <div class="t1 by"></div>
  </div>
  <div class="insdir_r">
  <div class="t1 bs"></div> <div class="t2 bs"></div>
  <div class="insdir_rbh">
  <div id="introducetd">
   <p><strong><span><?php echo $step;?>：</span>文件权限检测</strong></p>	
         <p> 开始文件权限检测...
	       <p>
            <?php
              usleep(200000);
              echo '<br />';
              echo is_writeable(JOYCMS_PATH)&&is_readable(JOYCMS_PATH)?' 根目录通过检测...':' <font color="#ff0000">根目录未通过检测...</font>';
              foreach ($patharray as $path)
              {
                ob_flush();
                str_pad(' ',256);
                $dirname=basename($path);
                if(@is_writeable($path)&&is_readable($path)&&file_put_contents($path.'/install.tmp','Install files'))
                {
                  echo file_exists($path.'/install.tmp')?'<br />目录 '.($dirname?$dirname:'根目录').' 通过检测...':'<br />目录 '.($dirname?$dirname:'根目录').' <font color="#ff0000">未通过检测，请将该目录设为0777后继续安装！</font>';
                  @unlink($path.'/install.tmp');
                }
                else
                {
                  echo '<br />目录 '.($dirname?$dirname:'根目录').' <font color="#ff0000">未通过检测，请将该目录设为0777后继续安装！</font>';
                }
                echo '<script language="javascript">sc();</script>';
                flush();
                usleep(200000); 
              }
            ?>
         </p>
      <br />
	  提示：检测完成，如果有检测未成功的目录，请将该目录设为0777再继续安装!</p>
	  <script language="javascript">sc();</script>
  </div>
</div>
    <div class="t2 bs"></div> <div class="t1 bs"></div>
  </div>
  </div>

      <div class="ins_rin" align="center">
     <form id="install" action="install.php?" method="post">
	<input type="hidden" name="step" value="5">
    <span><input onClick="javascript:history.back(-1);" type="button" name="step" value="返回上一步"style='background:url(install/template/images/bgbtn.gif);width:108px;height:27px;max-height:27px; line-height:27px;border:0px;cursor:pointer;font-size:13px;margin-top:1px; text-align:center; color:#FFF;'/></span> <span><input onClick="$('#install').submit();" type="button" name="step" value="通过检测继续"style='background:url(install/template/images/bgbtn.gif);width:108px;height:27px;max-height:27px; line-height:27px;border:0px;cursor:pointer;font-size:13px;margin-top:1px; text-align:center; color:#FFF;'/></span>
    </form>
      </div>
  </div>
</div>
</body>
</html>